import { service as request, BasePath } from '../request'

/**
  * 获取所有车辆
  * @returns {Object} Promise
  */
export const getVehicleByAll = () => request({
  url: `${BasePath}/vehicle/byAll`,
  method: 'GET'
})

/**
  * 删除所选车辆
  * @returns {Object} Promise
  */
export const delVehicleByID = (delID) => request({
  url: `${BasePath}/vehicle/deleting?ids=${delID}`,
  method: 'GET'
})

/**
  * 创建车辆
  * @returns {Object} Promise
  */
export const addVehicle = (data) => request({
  url: `${BasePath}/vehicle/creating`,
  method: 'POST',
  data
})

/**
  * 修改车辆
  * @returns {Object} Promise
  */
export const editVehicle = (data) => request({
  url: `${BasePath}/vehicle/updating`,
  method: 'POST',
  data
})

/**
  * 获取车辆品牌列表
  * @returns {Object} Promise
  */
export const getBrandList = () => request({
  url: `${BasePath}/brand/byAll`,
  method: 'GET'
})

/**
  * 获取运营单位列表
  * @returns {Object} Promise
  */
export const getoperatingUnitList = () => request({
  url: `${BasePath}/vehicle/operatingunit/byAll`,
  method: 'GET'
})
